var util=require('../../utils/util.js')
Page({

  data: {
    out_trade_no:'',
    orderNo: ''
  },
  onLoad:function(options){
    var out_trade_no = options.out_trade_no;
    var orderNo=options.orderNo;
    this.setData({
      out_trade_no: out_trade_no,
      orderNo: orderNo 
    })
  },
  goToOrder:function(){
    var url = 'pay/testnotify';
    url += "?out_trade_no=" + this.data.out_trade_no;
    util.fetchGet(
      url,
      function (ret) {
        console.log(ret);
        wx.switchTab({
          url: '/pages/order/order',
        })
      }
    )
    
  },
  goToOrderFail:function(){
    wx.redirectTo({
      url: '/pages/orderDetail/orderDetail?orderNo=' + this.data.orderNo,
    })
  }

  
})